﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Runtime.Serialization;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Windows.Forms;
using SqlCeViewer.CommonMethod;
using XLCS.Serialize;

namespace SqlCeViewer.Utility
{
    internal class SerializeClass
    {
        public static void SaveHistory(List<string> list)
        {
            SerializedFile.SaveFile(Config.DbHistoryFileFullPath, list);
        }

        /// <summary>
        /// Must return not null object
        /// </summary>
        /// <returns></returns>
        public static List<string> GetHistoryList()
        {
            List<string> result=SerializedFile.OpenFile(Config.DbHistoryFileFullPath) as List<string>;
            if (result == null)
            {
                result = new List<string>();
            }
            return result;
        }
    }
}
